<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$router->get('/', function () use ($router) {
    return $router->app->version();
});


//后台接口
$router->group(['prefix'=>'api/admin', 'namespace'=>'Admin'], function () use ($router) {
    $router->post('login', 'IndexController@dologin'); //登录
    $router->post('leftmenu', 'IndexController@leftMenu'); //左侧菜单
    //功能
    $router->post('action/index', 'IndexController@getActionIndex'); //功能列表
    $router->post('action/one', 'IndexController@getActionOne'); //功能一个
    $router->post('action/parent', 'IndexController@getParent'); //父级功能
    $router->post('action/update', 'IndexController@actionUpdate'); //保存
    $router->post('action/del', 'IndexController@actionDel');
    //管理员
    $router->post('admin/index', 'AdminController@getIndex');
    $router->post('admin/one', 'AdminController@getOne');
    $router->post('admin/save', 'AdminController@save');
    $router->post('admin/pwd', 'AdminController@setPwd');
//    //设备管理
//    $router->post('device/pas/index', 'DeviceController@getPasIndex');
//    $router->post('device/pas/modify', 'DeviceController@pasModify');
//    $router->post('device/pas/del', 'DeviceController@pasDel');
//    $router->post('device/option', 'DeviceController@getOption');
//    $router->post('device/index', 'DeviceController@getIndex');
//    $router->post('device/modify', 'DeviceController@modify');
    //图库
    $router->post('image/upload', 'ImageController@upload');
    //用户
    $router->post('user/index', 'UserController@getIndex');
    //案例公司+设计师
    $router->group(['prefix'=>'case'], function () use ($router) {
        //案例导览
        $router->post('index', 'CaseController@getIndex');
        $router->post('one', 'CaseController@getOne');
        $router->post('modify', 'CaseController@modify');
        $router->post('del', 'CaseController@del');
        //案例分类
        $router->post('cate/option', 'CateController@caseOption');
        $router->post('cate/index', 'CateController@caseIndex');
        $router->post('cate/modify', 'CateController@modify');
        $router->post('cate/del', 'CateController@del');
        //公司
        $router->post('company/index', 'CaseComController@getIndex');
        $router->post('company/modify', 'CaseComController@modify');
        $router->post('company/del', 'CaseComController@del');
        //设计师
        $router->post('designer/option', 'CaseDesignerController@getOption');
        $router->post('designer/index', 'CaseDesignerController@getIndex');
        $router->post('designer/one', 'CaseDesignerController@getOne');
        $router->post('designer/modify', 'CaseDesignerController@modify');
        $router->post('designer/del', 'CaseDesignerController@del');
    });
    //案例需求订单
    $router->group(['prefix'=>'casexq'], function () use ($router) {
        //案例上传
        $router->post('index', 'CaseXqController@getIndex');
        $router->post('one', 'CaseXqController@getOne');
        $router->post('modify', 'CaseXqController@modify');
        $router->post('del', 'CaseXqController@del');
        //订单流程
        $router->post('order/index', 'CxOrderController@getIndex');
        $router->post('order/sure', 'CxOrderController@setSure');
        $router->post('order/finish', 'CxOrderController@setFinish');
        $router->post('order/one', 'CxOrderController@getOne');
        $router->post('order/upload/img', 'CxOrderController@uploadImg');
        $router->post('order/upload/video', 'CxOrderController@uploadVideo');
        $router->post('order/upload/zip', 'CxOrderController@uploadZip');
    });
});


//PC接口
$router->group(['prefix'=>'api/pc', 'namespace'=>'Front'], function () use ($router) {
    $router->get('index', 'IndexController@getIndex'); //首页
//    //知识产权二级页面
//    $router->get('property/list', 'IndexController@getPropertyList');
//    //法律咨询
//    $router->get('lawfirm/one', 'IndexController@getLawFirmOne');
//    $router->get('lawyer/one', 'IndexController@getLawyerOne');
    //注册+登录+发布+获取
    $router->post('user/regist', 'LoginController@doRegist');
    $router->post('user/login', 'LoginController@doLogin');
//    $router->get('yewu/index', 'YewuController@getIndex');
//    $router->post('yewu/add', 'YewuController@add');
//    //设计商城
//    $router->post('design/option', 'DesignCaseController@getOption');
//    $router->post('design/catebypid', 'DesignCaseController@cateByPid');
//    $router->post('design/areabypid', 'DesignCaseController@areaByPid');
//    $router->post('design/case/list', 'DesignCaseController@getIndex');
//    $router->post('design/case/add', 'DesignCaseController@add');
//    $router->post('design/demand/list', 'DesignDemandController@getIndex');
//    $router->post('design/demand/add', 'DesignDemandController@add');
//    //设备商城
//    $router->post('device/option', 'DeviceController@getOption');
    //原创案例-导览
    $router->post('case/catelist', 'CaseController@getCateList');
    $router->post('case/index', 'CaseController@getIndex');
    $router->post('case/one', 'CaseController@getOne');
    $router->post('case/recommend/list', 'CaseController@getRecommendList');
    $router->post('case/like/add', 'CaseController@setLike');
    $router->post('case/follow/add', 'CaseController@setFollow');
    $router->post('case/collect/add', 'CaseController@setCollect');
    $router->post('case/forward/add', 'CaseController@setForward');
    $router->post('case/jubao/add', 'CaseController@setJubao');
    $router->post('case/online/add', 'CaseController@onlineAdd');
    $router->post('case/online/reply', 'CaseController@onlineReply');
    $router->get('case/zip', 'CaseController@zip');
    $router->get('case/down', 'CaseController@down');
    //原创案例-上传
    $router->post('casexq/catelist', 'CasexqController@getCateList');
    $router->post('casexq/index', 'CasexqController@getIndex');
    $router->post('casexq/one', 'CasexqController@getOne');
    $router->post('casexq/almost/list', 'CasexqController@getAlmostList');
    $router->post('casexq/designer/list', 'CasexqController@getDesignerList');
    $router->post('casexq/collect/add', 'CasexqController@setCollect');
    $router->post('casexq/forward/add', 'CasexqController@setForward');
    $router->post('casexq/jubao/add', 'CasexqController@setJubao');
    $router->post('casexq/almost/add', 'CasexqController@setAlmost');
    $router->post('casexq/order/apply', 'CasexqController@orderApply'); //下单申请
    //订单支付
    $router->get('pay/wxtoken', 'WxAuthController@wxtoken'); //微信测试
    $router->post('pay/wx/test', 'PayWxController@test'); //微信测试
    $router->post('pay/wx/pay', 'PayWxController@pay'); //微信支付
    $router->get('pay/wx/notice', 'PayWxController@notice'); //微信通知
    $router->post('pay/wx/notice', 'PayWxController@notice'); //微信通知
    $router->post('pay/wx/refund', 'PayWxController@refund'); //微信退款
    $router->post('pay/zfb/test', 'PayZfbController@test'); //支付宝测试
    $router->post('pay/zfb/pay', 'PayZfbController@pay'); //支付宝支付
    $router->get('pay/zfb/notice', 'PayZfbController@notice'); //支付宝通知
    $router->post('pay/zfb/notice', 'PayZfbController@notice'); //支付宝通知
    $router->post('pay/zfb/query', 'PayZfbController@query'); //支付宝查询
    $router->post('pay/zfb/refund', 'PayZfbController@refund'); //退款
    $router->post('pay/zfb/refund/query', 'PayZfbController@refundQuery'); //退款查询
});